﻿namespace Zove.Query {
    public class QueryResult {

        public string Item {
            get;
            set;
        }

        public string Value {
            get;
            set;
        }

        public string Solution {
            get;
            set;
        }

        public string Unit {
            get;
            set;
        }

        public QueryResult(string item, string value, string unit, string solution) {
            this.Item = item;
            this.Value = value;
            this.Solution = solution;
            this.Unit = unit;
        }

        public override string ToString() {
            return 
                string.IsNullOrEmpty(Unit) ? 
                string.Format("{0} = {1}", Item, Value) :
                string.Format("{0} = {1} {2}", Item, Value, Unit);
        }
    }
}
